package collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArrayToListDemo {
    public static void main(String[] args) {
        String[] arr = {"one", "two", "three", "four", "five"};
        System.out.println(Arrays.toString(arr));

        List<String> list = Arrays.asList(arr);
        System.out.println(list);

        //对集合的操作就是对原数组的操作
        list.set(0,"zero");
        System.out.println(list);
        //java.lang.UnsupportedOperationException
        //list.add("six");
        List<String> list1 = new ArrayList<>(list);//
        list1.add("six");
        System.out.println(list1);
    }
}
